from django.conf.urls import url
from snippets import views
from django.conf.urls import include

urlpatterns = [
    # url(r'^snippets/$', views.snippet_list2),
    # url(r'^snippets/(?P<pk>[0-9]+)/$', views.snippet_detail2),


    url(r'^snippets/$', views.SnippetList.as_view()),
    url(r'^snippets/(?P<pk>[0-9]+)/$', views.SnippetDetail.as_view()),


    url(r'^user/$', views.UserList.as_view()),
    url(r'^user/(?P<pk>[0-9]+)/$', views.UserDetail.as_view()),

    #开启用户登入功能
    url(r'^api-auth/', include('rest_framework.urls',
                               namespace='rest_framework')),
]